home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / gfx / 3d / irit50src.lha / irit5 / include / geomat3d.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-22  |  2.9 KB  |  91 lines

  1. /******************************************************************************
  2. * GeoMat3d.h - Trans. Matrices , Vector computation, and Comp.geom.          *
  3. *******************************************************************************
  4. * Written by Gershon Elber, March 1990.                          *
  5. ******************************************************************************/
  6.  
  7. #ifndef    GEOMAT_3D_H
  8. #define GEOMAT_3D_H
  9.  
  10. #include "iritprsr.h"
  11.  
  12. /* Used by the Ray & Polygon intersection (Jordan theorem): */
  13. #define BELOW_RAY    1
  14. #define ON_RAY        2
  15. #define ABOVE_RAY    3
  16.  
  17. #if defined(__cplusplus) || defined(c_plusplus)
  18. extern "C" {
  19. #endif
  20.  
  21. /* And prototypes of the functions: */
  22.  
  23. void GMVecCopy(VectorType Vdst, VectorType Vsrc);
  24. void GMVecNormalize(VectorType V);
  25. RealType GMVecLength(VectorType V);
  26. void GMVecCrossProd(VectorType Vres, VectorType V1, VectorType V2);
  27. int GMColinear3Pts(PointType Pt1, PointType Pt2, PointType Pt3);
  28. RealType GMVecDotProd(VectorType V1, VectorType V2);
  29.  
  30. IPObjectStruct *GMGenMatObjectRotX(RealType *Degree);
  31. IPObjectStruct *GMGenMatObjectRotY(RealType *Degree);
  32. IPObjectStruct *GMGenMatObjectRotZ(RealType *Degree);
  33. IPObjectStruct *GMGenMatObjectTrans(VectorType Vec);
  34. IPObjectStruct *GMGenMatObjectScale(VectorType Vec);
  35. IPObjectStruct *GMGenMatObjectGeneric(IPObjectStruct *LstObjList);
  36. IPObjectStruct *GMTransformObject(IPObjectStruct *PObj, MatrixType Mat);
  37. IPObjectStruct *GMTransformObjectList(IPObjectStruct *PObj, MatrixType Mat);
  38.  
  39. /* And the computational geometry routines: */
  40. RealType CGDistPointPoint(PointType P1, PointType P2);
  41. int CGPlaneFrom3Points(PlaneType Plane,
  42.                PointType Pt1,
  43.                PointType Pt2,
  44.                PointType Pt3);
  45. void CGPointFromPointLine(PointType Point,
  46.               PointType Pl,
  47.               PointType Vl,
  48.               PointType ClosestPoint);
  49. RealType CGDistPointLine(PointType Point, PointType Pl, PointType Vl);
  50. RealType CGDistPointPlane(PointType Point, RealType Plane[4]);
  51. int CGPointFromLinePlane(PointType Pl,
  52.              PointType Vl,
  53.              RealType Plane[4],
  54.              PointType InterPoint,
  55.              RealType *t);
  56. int CGPointFromLinePlane01(PointType Pl,
  57.                PointType Vl,
  58.                RealType Plane[4],
  59.                PointType InterPoint,
  60.                RealType *t);
  61. int CG2PointsFromLineLine(PointType Pl1,
  62.               PointType Vl1,
  63.               PointType Pl2,
  64.               PointType Vl2,
  65.               PointType Pt1,
  66.               RealType *t1,
  67.               PointType Pt2,
  68.               RealType *t2);
  69. RealType CGDistLineLine(PointType Pl1,
  70.             PointType Vl1,
  71.             PointType Pl2,
  72.             PointType Vl2);
  73.  
  74. int CGPolygonRayInter(IPPolygonStruct *Pl, PointType PtRay, int RayAxes);
  75. int CGPolygonRayInter3D(IPPolygonStruct *Pl, PointType PtRay, int RayAxes);
  76. void CGGenTransMatrixZ2Dir(MatrixType Mat,
  77.                VectorType Trans,
  78.                VectorType Dir,
  79.                RealType Scale);
  80. void CGGenTransMatrixZ2Dir2(MatrixType Mat,
  81.                 VectorType Trans,
  82.                 VectorType Dir,
  83.                 VectorType Dir2,
  84.                 RealType Scale);
  85.  
  86. #if defined(__cplusplus) || defined(c_plusplus)
  87. }
  88. #endif
  89.  
  90. #endif    /* GEOMAT_3D_H */
  91.